#include <stdio.h>
int main()
{
    int seconds,a,b,c,d;
    scanf("%d",&seconds);
    a=seconds/3600;
    b=seconds%3600;
    c=b/60;
    d=b%60;
    printf("%d %d %d",a,c,d);
    return 0;
}
